//
//  TFCameraView.swift
//  TalkfunSDKDemo
//
//  Created by 邓盛明 on 2022/2/16.
//  Copyright © 2022 Talkfun. All rights reserved.
//

import UIKit

class TFCameraView: TFtouchesMoved {
    @objc public var view = UIView.init()
    //无网络的时候显示图标
    @objc public var netImgView:UIImageView!
    @objc public var videoExchangeBtn:UIButton!
  
    
    override init(frame: CGRect) {
        super.init(frame: frame)

        //超出主层边框的都会被裁减调用
          //设置裁剪
        self.layer.masksToBounds =  true
        // 圆角半径  能把一个下正文体,改成圆形
        self.layer.cornerRadius = 4
        
        self.view.isUserInteractionEnabled = false
        self.view.backgroundColor = self.backgroundColor;
        addSubview(self.view)
        
        self.netImgView = UIImageView.init()
        self.netImgView.isUserInteractionEnabled = false
        self.netImgView.image = UIImage.init(named: "HTLive.bundle/neterror")
        self.netImgView.isHidden = true
        addSubview(self.netImgView)
        //视频与ppt切换
        self.videoExchangeBtn = UIButton.init()
        self.videoExchangeBtn.setImage(UIImage.init(named: "HTLive.bundle/video_switch"), for: .normal)
        addSubview(self.videoExchangeBtn)
       
    }

    override func layoutSubviews() {
        super.layoutSubviews()
        self.view.frame = self.bounds;
        self.netImgView.frame = self.view.bounds;
        self.videoExchangeBtn.frame = CGRect(x: self.frame.size.width-34, y: self.frame.size.height-32, width: 30, height: 30)
      
    }
    
    
    required init?(coder: NSCoder) {
        fatalError("init(coder:) has not been implemented")
    }
}
